package com.tlgen.modules.system.repository;

import com.tlgen.modules.system.domain.Medical;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

public interface MedicalRepository extends JpaRepository<Medical, Long>, JpaSpecificationExecutor<Medical> {

    /**
     *根据名称查询
     * @param name
     * @return
     */
    Medical findByName(String name);


    /**
     *根据ID查询名称
     * @param id
     * @return
     */
    @Query(value = "select name from medical where id = ?1", nativeQuery = true)
    String findNameById(Long id);
}
